home *** CD-ROM | disk | FTP | other *** search
- Path: solaris.cc.vt.edu!usenet
- From: Ashutosh Gokhale <ashutosh>
- Newsgroups: comp.lang.c++
- Subject: Fastest way to index thru an array????
- Date: 10 Jan 1996 22:54:44 GMT
- Organization: Virginia Tech, Blacksburg, Virginia
- Message-ID: <4d1g3k$o09@solaris.cc.vt.edu>
- NNTP-Posting-Host: cadsta12.cadlab.vt.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- NNTP-Posting-User: ashutosh
- X-Mailer: Mozilla 1.1N (X11; I; AIX 2)
- X-URL: news:comp.lang.c++
-
- Suppose I have an array A[][][] which I declare as
- double ***A and then assign memory to it using new operator.
- Now consider that A has dimensions A[50][60][70]. Then I can index thru ALL
- entries of A using
- for(i=1; i<50; i++)
- {
- for(j=1; j<60; j++)
- {
- for(k=1; k<70; k++)
- {
- A[i][j][k] = <some expression>;
- }
- }
- }
- But the above way is surely the most time-INEFFICIENT way.
- Can someone suggest me the MOST time efficient way of indexing through A[][][]?
-
- Thanks a lot
-
-